package com.qf.controller;

import com.qf.entity.TlAdmin;
import com.qf.service.AdminService;
import com.qf.utils.ResultMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/admin")
public class AdminController {

    @Autowired
    AdminService adminService;

    @GetMapping("/login")
    public ResultMsg adminlogin(String adminName,String adminPass){
        return adminService.adminlogin(adminName,adminPass);
    }
    @PostMapping("/updateadmin")
    public ResultMsg updateadmin(@RequestBody TlAdmin admin){
       return adminService.updateadmin(admin);
    }
    @GetMapping("/uppic")
    public ResultMsg uppic(MultipartFile file){
        return adminService.uppic(file);
    }
    @GetMapping("/findadmin")
    public ResultMsg findmin(HttpServletRequest request){
        return adminService.findadmin(request);
    }
}
